package com.edu.demo.entity.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author XYH
 * date 2024-03-08
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class RegisterByEmailVO {
    @Pattern(regexp = "^[\\w.-]+@[\\w-]+\\.\\w{2,6}$", message = "不是有效的电子邮件地址")
    @ApiModelProperty(value = "邮箱", required = true)
    private String email;

    @Pattern(regexp = "\\d+", message = "请输入纯数字")
    @ApiModelProperty(value = "验证码", required = true)
    private String code;

    @NotNull(message = "密码不能为空")
    @Length(min = 6, max = 11, message = "密码必须在6-11位")
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).+$", message = "码必须包含大小写字母和数字")
    @ApiModelProperty(value = "密码", required = true)
    private String password;


    @ApiModelProperty(value = "验证码获取时间", required = false)
    private long getCodeTime;
}
